﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Linq.Expressions;

    internal sealed class ClientQueryable<T> : IQueryable<T>, IQueryable, IEnumerable<T>, IEnumerable
    {
        private System.Linq.Expressions.Expression m_exp;
        private ClientQueryProvider m_provider;

        public ClientQueryable(ClientQueryProvider provider, System.Linq.Expressions.Expression exp)
        {
            this.m_provider = provider;
            this.m_exp = exp;
        }

        public IEnumerator<T> GetEnumerator()
        {
            throw new NotSupportedException();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            throw new NotSupportedException();
        }

        public Type ElementType
        {
            get
            {
                return typeof(T);
            }
        }

        public System.Linq.Expressions.Expression Expression
        {
            get
            {
                return this.m_exp;
            }
        }

        public IQueryProvider Provider
        {
            get
            {
                return this.m_provider;
            }
        }
    }
}

